package com.bean;

import java.util.List;

public class PageBean<T> {
	private Integer pageIndex = 1;
	private Integer pageSize = 5;
	private Integer pageCount;
	private Integer totalCount = 0;
	private List<T> list;
	
	
	public Integer getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(Integer pageIndex) {
		if (pageIndex > 0) {
			this.pageIndex = pageIndex;
		}
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		if (pageSize > 0) {
			this.pageSize = pageSize;
		}
		setPageCount();
	}
	public Integer getPageCount() {
		return pageCount;
	}
	public void setPageCount() {
		this.pageCount = totalCount%pageSize==0? totalCount/pageSize:totalCount/pageSize+1;
	}
	public Integer getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
		setPageCount();
	}
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
}
